*Figure 3
gen lab=""
gen heading=""
gen heading_pos=.
gen heading_x=0
foreach sample in all {
local s=0
foreach sample2 in all   {
	local s=`s'+1
	matrix C =J(17,3,.)
*Run regression
	reg pref_b ej_ut_b- conf_b sekuhara_b if `sample'==1 & `sample2'==1 & dominant==0 [pw= gen_edu2_alder5_w],  cluster(id)
*Store WTP estiamtes
	local w=((_b[high_5_b]/5)+(_b[high_10_b]/10)-(_b[low_5_b]/5))/.03
	matrix C[3,1]=_b[ej_ut_b]/`w'
	matrix C[3,2]=(_b[ej_ut_b]+1.96*_se[ej_ut_b])/`w'
	matrix C[3,3]=(_b[ej_ut_b]-1.96*_se[ej_ut_b])/`w'
	matrix C[2,1]=0
	matrix C[1,1]=_b[mkt_ut_b]/`w'
	matrix C[1,2]=(_b[mkt_ut_b]+1.96*_se[mkt_ut_b])/`w'
	matrix C[1,3]=(_b[mkt_ut_b]-1.96*_se[mkt_ut_b])/`w'
	matrix C[7,1]=_b[ej_inf_b]/`w'
	matrix C[7,2]=(_b[ej_inf_b]+1.96*_se[ej_inf_b])/`w'
	matrix C[7,3]=(_b[ej_inf_b]-1.96*_se[ej_inf_b]) /`w'
	matrix C[6,1]=0
	matrix C[5,1]=_b[fri_sch_b]/`w'
	matrix C[5,2]=(_b[fri_sch_b]+1.96*_se[fri_sch_b])/`w'
	matrix C[5,3]=(_b[fri_sch_b]-1.96*_se[fri_sch_b])/`w'
	matrix C[12,1]=_b[happy_b] /`w'
	matrix C[12,2]=(_b[happy_b]+1.96*_se[happy_b])/`w'
	matrix C[12,3]=(_b[happy_b]-1.96*_se[happy_b])/`w'
	matrix C[11,1]=0
	matrix C[10,1]=_b[sekuhara_b]/`w'
	matrix C[10,2]=(_b[sekuhara_b]+1.96*_se[sekuhara_b])/`w'
	matrix C[10,3]=(_b[sekuhara_b]-1.96*_se[sekuhara_b])/`w'
	matrix C[9,1]=_b[conf_b]/`w'
	matrix C[9,2]=(_b[conf_b]+1.96*_se[conf_b])/`w'
	matrix C[9,3]=(_b[conf_b]-1.96*_se[conf_b])/`w'
	svmat C
	matrix list C
	ren C1 est_`s'
	ren C2 ci_low_`s'
	ren C3 ci_high_`s'
	gen pos_`s'=_n if est_`s'!=.
}

twoway (scatter  pos_1 est_1  , msize(medlarge)  msymbol(circle)   mcolor(black)) ///
	(rbar ci_low_1 ci_high_1 pos_1 , lwidth(vvthin) lcolor(maroon) lpattern(solid) horizontal barwidth(.015)) ///
	,xline(0, lcolor(gs7) lpattern(dash)) yline(4 8, lcolor(gs1) lpattern(dot)) ///
	ylabel(  3 "Not Very Developing" 2 "Developing" 1 "Very Developing" ///
	7 "No Flexibility" 6 "1 Hour Flexibility" 5 "Free Scheduling" ///
	12 "Good Atmosphere" 11 "No Information" 10 "Sexual Harassment" 9 "Manager Conflict" ///
	,labsize(medlarge) angle(horizontal))  scale(.7) ysize(20) xsize(20) scheme(s1mono) title(`sample' `gen')
graph save hara_wtp_`sample', replace
	drop est_1- pos_1
}

foreach sample in all {
local s=0
foreach sample2 in wom  man	   {
	local s=`s'+1
	matrix C =J(17,3,.)
*Run regression	
	reg pref_b ej_ut_b- conf_b sekuhara_b if `sample'==1 & `sample2'==1 & dominant==0 [pw= gen_edu2_alder5_w],  cluster(id)
*Store estimates
	local w=((_b[high_5_b]/5)+(_b[high_10_b]/10)-(_b[low_5_b]/5))/.03
	matrix C[3,1]=_b[ej_ut_b]/`w'
	matrix C[3,2]=(_b[ej_ut_b]+1.96*_se[ej_ut_b])/`w'
	matrix C[3,3]=(_b[ej_ut_b]-1.96*_se[ej_ut_b])/`w'
	matrix C[2,1]=0
	matrix C[1,1]=_b[mkt_ut_b]/`w'
	matrix C[1,2]=(_b[mkt_ut_b]+1.96*_se[mkt_ut_b])/`w'
	matrix C[1,3]=(_b[mkt_ut_b]-1.96*_se[mkt_ut_b])/`w'
	matrix C[7,1]=_b[ej_inf_b]/`w'
	matrix C[7,2]=(_b[ej_inf_b]+1.96*_se[ej_inf_b])/`w'
	matrix C[7,3]=(_b[ej_inf_b]-1.96*_se[ej_inf_b]) /`w'
	matrix C[6,1]=0
	matrix C[5,1]=_b[fri_sch_b]/`w'
	matrix C[5,2]=(_b[fri_sch_b]+1.96*_se[fri_sch_b])/`w'
	matrix C[5,3]=(_b[fri_sch_b]-1.96*_se[fri_sch_b])/`w'
	matrix C[12,1]=_b[happy_b] /`w'
	matrix C[12,2]=(_b[happy_b]+1.96*_se[happy_b])/`w'
	matrix C[12,3]=(_b[happy_b]-1.96*_se[happy_b])/`w'
	matrix C[11,1]=0
	matrix C[10,1]=_b[sekuhara_b]/`w'
	matrix C[10,2]=(_b[sekuhara_b]+1.96*_se[sekuhara_b])/`w'
	matrix C[10,3]=(_b[sekuhara_b]-1.96*_se[sekuhara_b])/`w'
	matrix C[9,1]=_b[conf_b]/`w'
	matrix C[9,2]=(_b[conf_b]+1.96*_se[conf_b])/`w'
	matrix C[9,3]=(_b[conf_b]-1.96*_se[conf_b])/`w'
	svmat C
	matrix list C
	ren C1 est_`s'
	ren C2 ci_low_`s'
	ren C3 ci_high_`s'
	gen pos_`s'=_n if est_`s'!=.
}

replace pos_1=pos_1+.15
replace pos_2=pos_2-.15
twoway (scatter  pos_1 est_1  , msize(medlarge)  msymbol(circle)   mcolor(maroon)) ///
	(rbar ci_low_1 ci_high_1 pos_1 , lwidth(vvthin) lcolor(maroon) lpattern(solid) horizontal barwidth(.015)) ///
	(scatter  pos_2 est_2  , msize(medlarge)  msymbol(circle)  mcolor(navy)) ///
	(rbar ci_low_2 ci_high_2 pos_2 , lwidth(vvthin) lcolor(navy) lpattern(solid) horizontal barwidth(.015)) ///
	,xline(0, lcolor(gs7) lpattern(dash)) yline(4 8, lcolor(gs1) lpattern(dot)) ///
	ylabel(  3 "Little Skill Development" 2 "Moderate Skill Development" 1 "High Skill Development" ///
 7 "No Schedule Flexibility" 6 "1 Hour Flexibility" 5 "Free Scheduling" ///
12 "Good Atmosphere" 11 "No Information" 10 "Sexual Harassment" 9 "Conflict with Mangager" ///
, labsize(medlarge) angle(horizontal))  scale(.7) ysize(20) xsize(20) scheme(s1mono) title(`sample' `gen')
graph save hara_wtpsplit_`sample', replace
drop est_1- pos_2
}
graph combine hara_wtp_all.gph hara_wtpsplit_all.gph, ///
scheme(s1mono) ysize(14) xsize(20) ycommon xcommon iscale(.7) col(2)
graph save Figure_3, replace

*Figure 4
preserve
local s=0
foreach sample in  all wd mix md high_risk low_risk {
	local s=`s'+1
	matrix C =J(6,6,.)
*Run regression
	reg pref_b ej_ut_vic- sekuhara_vic ej_ut_by-sekuhara_by if    dominant==0 & `sample'==1 [pw= gen_edu2_alder5_w] ,   cluster(id) 
*Store estimates
	local w_by=((_b[high_5_by]/5)+(_b[high_10_by]/10)-(_b[low_5_by]/5))/.03
	local w_vic=((_b[high_5_vic]/5)+(_b[high_10_vic]/10)-(_b[low_5_vic]/5))/.03
	nlcom (wtp_by: _b[sekuhara_by]/`w_by') ///
	(wtp_vic: _b[sekuhara_vic]/`w_vic'), post
	matrix C[`s',1]=_b[wtp_by]
	matrix C[`s',2]=(_b[wtp_by]+1.96*_se[wtp_by])
	matrix C[`s',3]=(_b[wtp_by]-1.96*_se[wtp_by])
	matrix C[`s',4]=_b[wtp_vic]
	matrix C[`s',5]=(_b[wtp_vic]+1.96*_se[wtp_vic])
	matrix C[`s',6]=(_b[wtp_vic]-1.96*_se[wtp_vic])
*Test for difference in estimates across those that see an opposite sex and same sex victim
	test _b[wtp_vic] =_b[wtp_by]
	local p`s'=  r(p)
	svmat C
	ren C1 est_y_`s'
	ren C2 ci_low_y_`s'
	ren C3 ci_high_y_`s'
	gen pos_y_`s'=`s'-.2 if est_y_`s'!=.
	ren C4 est_n_`s'
	ren C5 ci_low_n_`s'
	ren C6 ci_high_n_`s'
	gen pos_n_`s'=`s'+.2 if est_n_`s'!=.
}
*Name relvant variables for figure
foreach var in est ci_low ci_high pos{
	gen `var'_by=`var'_y_1 if _n==1
	replace `var'_by=`var'_y_5 if _n==5
	replace `var'_by=`var'_y_6 if _n==6
	gen `var'_vic=`var'_n_1 if _n==1
	replace `var'_vic=`var'_n_5 if _n==5
	replace `var'_vic=`var'_n_6 if _n==6
	gen `var'_man=`var'_n_2 if _n==2
	replace `var'_man=`var'_y_3 if _n==3
	replace `var'_man=`var'_y_4 if _n==4
	gen `var'_wom=`var'_y_2 if _n==2
	replace `var'_wom=`var'_n_3 if _n==3
	replace `var'_wom=`var'_n_4 if _n==4
 }
replace pos_by = 1 if _n==1
replace pos_vic = 2 if _n==1
replace pos_by = 2.8 if _n==5
replace pos_vic =3.2 if _n==5
replace pos_by = 3.8 if _n==6
replace pos_vic =4.2 if _n==6
replace pos_man=pos_man+3
replace pos_wom=pos_wom+3

twoway (rbar ci_low_wom ci_high_wom pos_wom , lwidth(vvthin)  fcolor(maroon) lcolor(maroon) lpattern(solid) barwidth(.015)) ///
	(scatter est_wom pos_wom   , msize(medlarge)  msymbol(circle)   mcolor(maroon)) ///
	(rbar ci_low_man ci_high_man pos_man , lwidth(vvthin)  fcolor(navy) lcolor(navy) lpattern(solid) barwidth(.015)) ///
	(scatter est_man pos_man   , msize(medlarge)  msymbol(circle)   mcolor(navy)) ///
	(rbar ci_low_by ci_high_by pos_by , lwidth(vvthin)  fcolor(gs5) lcolor(gs5) lpattern(solid) barwidth(.015)) ///
	(scatter est_by pos_by   , msize(medlarge)  msymbol(circle)   mcolor(gs5)) ///
	(rbar ci_low_vic ci_high_vic pos_vic , lwidth(vvthin)  fcolor(gs1) lcolor(gs1) lpattern(solid) barwidth(.015)) ///
	(scatter est_vic pos_vic   , msize(medlarge)  msymbol(circle)   mcolor(gs1)) ///
	,xline( 2.5 3.5 4.5 5.5 6.5, lcolor(gs1) lpattern(dash))  legend(order(2 "Women" 4 "Men")) ///
	xscale(range(0.5 7.5)) yline(0, lcolor(gs7) lpattern(dash)) ///
	ylabel( , labsize(medsmall) angle(horizontal))  ///
	scale(1) ysize(15) xsize(20) scheme(s1mono) ///
	xlabel( 1 "Opposite-Sex Victim Sex as Perpetrator in Vignette" 2 "Same-Sex Victim Same Sex as Victim in Vignette" ///
	2.8 "Opposite-Sex Victim" 3.2 "Same-Sex Victim" 3.8 "Opposite-Sex Victim" 4.2 "Same-Sex Victim" /// 
	4.8 "Opposite-Sex Victim" 5.2 "Same-Sex Victim" 5.8 "Opposite-Sex Victim" 6.2 "Same-Sex Victim" ///
	6.8 "Opposite-Sex Victim" 7.2 "Same-Sex Victim", labsize(medsmall))  ///
	title(p-value = 0`p1' p-value = 0`p5' p-value = 0`p6' p-value = 0`p2' p-value = 0`p3' p-value = 0`p4')
graph save Figure_4, replace
restore

*Figure 5		
foreach split in by{
preserve
gen start = 1
local s=0
matrix C =J(6,6,.)
foreach sample in  min_occ maj_occ aware not_aw sh_vimp sh_notvimp{
	local s=`s'+1
*Run regression
	reg pref_b ej_ut_vic- sekuhara_vic ej_ut_by-sekuhara_by if    dominant==0 & `sample'==1 [pw= gen_edu2_alder5_w] ,   cluster(id) 
*Store estimates
	local w_by=((_b[high_5_by]/5)+(_b[high_10_by]/10)-(_b[low_5_by]/5))/.03
	local w_vic=((_b[high_5_vic]/5)+(_b[high_10_vic]/10)-(_b[low_5_vic]/5))/.03
	nlcom (wtp_by: _b[sekuhara_by]/`w_by') ///
	(wtp_vic: _b[sekuhara_vic]/`w_vic'), post
	matrix C[`s',1]=_b[wtp_by]
	matrix C[`s',2]=(_b[wtp_by]+1.96*_se[wtp_by])
	matrix C[`s',3]=(_b[wtp_by]-1.96*_se[wtp_by])
	matrix C[`s',4]=_b[wtp_vic]
	matrix C[`s',5]=(_b[wtp_vic]+1.96*_se[wtp_vic])
	matrix C[`s',6]=(_b[wtp_vic]-1.96*_se[wtp_vic])
*Test for difference in WTP between those that see a same-sex and opposite-sex victim
	test _b[wtp_vic] =_b[wtp_by]
	local p`s'=  r(p)
}
svmat C
ren C1 est_by
ren C2 ci_low_by
ren C3 ci_high_by
gen pos_by=_n-.2 if est_by!=.
ren C4 est_vic
ren C5 ci_low_vic
ren C6 ci_high_vic
gen pos_vic=_n+.2 if est_vic!=.

twoway (rbar ci_low_by ci_high_by pos_by , lwidth(vvthin)  fcolor(gs5) lcolor(gs5) lpattern(solid) barwidth(.015)) ///
(scatter est_by pos_by   , msize(medlarge)  msymbol(circle)   mcolor(gs5)) ///
(rbar ci_low_vic ci_high_vic pos_vic , lwidth(vvthin)  fcolor(gs1) lcolor(gs1) lpattern(solid) barwidth(.015)) ///
(scatter est_vic pos_vic   , msize(medlarge)  msymbol(circle)   mcolor(gs1)) ///
	,xline(1.5 2.5 3.5 4.5 5.5  , lcolor(gs1) lpattern(dash))  xscale(range(0.5 6.5)) yline(0, lcolor(gs7) lpattern(dash)) ///
	ylabel( , labsize(medsmall) angle(horizontal))  scale(1) ysize(14) xsize(20) scheme(s1mono) title(`split' `gen') ///
	xlabel( .8 "Opposite Sex Victim" 1.2 "Same Sex Victim" 1.8 "Opposite Sex Victim" 2.2 "Same Sex Victim" /// 
	2.8 "Same Sex Victim" 3.2 "Same Sex Victim" 3.8 "Opposite Sex Victim" 4.2 "Same Sex Victim" 4.8 ///
	"Opposite Sex Victim"  5.2 "Same Sex Victim"  5.8 "Opposite Sex Victim" 4.2 "Same Sex Victim" 6.2 "Same Sex Victim"   , labsize(medsmall) angle(45))  ///
	title(p-value = 0`p1' p-value = 0`p2' p-value = 0`p3' p-value = 0`p4'  p-value = 0`p5'    p-value = 0`p6'   )
graph save hara_het_wtp, replace
restore
}

*Figure A10
foreach split in by{
preserve
gen start = 1
local s=0
matrix C =J(6,6,.)
foreach sample in  min_occ maj_occ aware not_aw sh_vimp sh_notvimp{
	local s=`s'+1
*Run regression
	reg pref_b ej_ut_vic- sekuhara_vic ej_ut_by-sekuhara_by if    dominant==0 & `sample'==1 [pw= gen_edu2_alder5_w] ,   cluster(id) 
*Store estimates
	local w_by=((_b[high_5_by]/5)+(_b[high_10_by]/10)-(_b[low_5_by]/5))/.03
	local w_vic=((_b[high_5_vic]/5)+(_b[high_10_vic]/10)-(_b[low_5_vic]/5))/.03
	nlcom (wtp_by: _b[sekuhara_by]/`w_by') ///
	(wtp_vic: _b[sekuhara_vic]/`w_vic'), post
	matrix C[`s',1]=_b[wtp_by]
	matrix C[`s',2]=(_b[wtp_by]+1.96*_se[wtp_by])
	matrix C[`s',3]=(_b[wtp_by]-1.96*_se[wtp_by])
	matrix C[`s',4]=_b[wtp_vic]
	matrix C[`s',5]=(_b[wtp_vic]+1.96*_se[wtp_vic])
	matrix C[`s',6]=(_b[wtp_vic]-1.96*_se[wtp_vic])
	test _b[wtp_vic] =_b[wtp_by]
	local p`s'=  r(p)
}
svmat C
ren C1 est_by
ren C2 ci_low_by
ren C3 ci_high_by
gen pos_by=_n-.2 if est_by!=.
ren C4 est_vic
ren C5 ci_low_vic
ren C6 ci_high_vic
gen pos_vic=_n+.2 if est_vic!=.

twoway (rbar ci_low_by ci_high_by pos_by , lwidth(vvthin)  fcolor(gs5) lcolor(gs5) lpattern(solid) barwidth(.015)) ///
	(scatter est_by pos_by   , msize(medlarge)  msymbol(circle)   mcolor(gs5)) ///
	(rbar ci_low_vic ci_high_vic pos_vic , lwidth(vvthin)  fcolor(gs1) lcolor(gs1) lpattern(solid) barwidth(.015)) ///
	(scatter est_vic pos_vic   , msize(medlarge)  msymbol(circle)   mcolor(gs1)) ///
	,xline(1.5 2.5 3.5 4.5 5.5  , lcolor(gs1) lpattern(dash))  xscale(range(0.5 6.5)) yline(0, lcolor(gs7) lpattern(dash)) ///
	ylabel( , labsize(medsmall) angle(horizontal))  scale(1) ysize(14) xsize(20) scheme(s1mono) title(`split' `gen') ///
	xlabel( .8 "Opposite Sex Victim" 1.2 "Same Sex Victim" 1.8 "Opposite Sex Victim" 2.2 "Same Sex Victim" /// 
	2.8 "Same Sex Victim" 3.2 "Same Sex Victim" 3.8 "Opposite Sex Victim" 4.2 "Same Sex Victim" 4.8 ///
	"Opposite Sex Victim"  5.2 "Same Sex Victim"  5.8 "Opposite Sex Victim" 4.2 "Same Sex Victim" 6.2 "Same Sex Victim"   , labsize(medsmall) angle(45))  ///
	title(p-value = 0`p1' p-value = 0`p2' p-value = 0`p3' p-value = 0`p4'  p-value = 0`p5'    p-value = 0`p6'   )
graph save Figure A10, replace
restore
}	
		
*Figure A16
foreach split in by{
preserve
local s=0
foreach sample in  all wd mix md 	 {
	local s=`s'+1
	matrix C =J(5,18,.)
*Run regression for those that see opposite-sex victim
	reg pref_b ej_ut_b- conf_b grope_b sexual_b sexist_b if `sample'==1 & `split'==1 & dominant==0 [pw= gen_edu2_alder5_w],  cluster(id)
*Store estimates
	local w=((_b[high_5_b]/5)+(_b[high_10_b]/10)-(_b[low_5_b]/5))/.03
	local c=0
	foreach sek in  grope_b sexual_b sexist_b{
		local c = `c'+1
		matrix C[`s',`c']=_b[`sek']/`w'
		local c = `c'+1
		matrix C[`s',`c']=(_b[`sek']+1.96*_se[`sek'])/`w'
		local c = `c'+1
		matrix C[`s',`c']=(_b[`sek']-1.96*_se[`sek'])/`w'
	}
*Run regression for those that see same-sex victim
	reg pref_b ej_ut_b- conf_b grope_b sexual_b sexist_b if `sample'==1 & `split'==0 & dominant==0  [pw= gen_edu2_alder5_w],  cluster(id)
	local w=((_b[high_5_b]/5)+(_b[high_10_b]/10)-(_b[low_5_b]/5))/.03
	foreach sek in  grope_b sexual_b sexist_b{
		local c = `c'+1
		matrix C[`s',`c']=_b[`sek']/`w'
		local c = `c'+1
		matrix C[`s',`c']=(_b[`sek']+1.96*_se[`sek'])/`w'
		local c = `c'+1
		matrix C[`s',`c']=(_b[`sek']-1.96*_se[`sek'])/`w'
}
	svmat C
	ren C1 est_g_y_`s'
	ren C2 ci_low_g_y_`s'
	ren C3 ci_high_g_y_`s'
	gen pos_g_y_`s'=`s'-.35 if est_g_y_`s'!=.
	ren C4 est_s_y_`s'
	ren C5 ci_low_s_y_`s'
	ren C6 ci_high_s_y_`s'
	gen pos_s_y_`s'=`s'-.25 if est_s_y_`s'!=.
	ren C7 est_h_y_`s'
	ren C8 ci_low_h_y_`s'
	ren C9 ci_high_h_y_`s'
	gen pos_h_y_`s'=`s'-.15 if est_h_y_`s'!=.
	ren C10 est_g_n_`s'
	ren C11 ci_low_g_n_`s'
	ren C12 ci_high_g_n_`s'
	gen pos_g_n_`s'=`s'+.15 if est_g_n_`s'!=.
	ren C13 est_s_n_`s'
	ren C14 ci_low_s_n_`s'
	ren C15 ci_high_s_n_`s'
	gen pos_s_n_`s'=`s'+.25 if est_s_n_`s'!=.
	ren C16 est_h_n_`s'
	ren C17 ci_low_h_n_`s'
	ren C18 ci_high_h_n_`s'
	gen pos_h_n_`s'=`s'+.35 if est_h_n_`s'!=.
}
foreach var in est_g ci_low_g ci_high_g pos_g est_s ci_low_s ci_high_s pos_s est_h ci_low_h ci_high_h pos_h{
	gen `var'_by=`var'_y_1 if _n==1
	gen `var'_vic=`var'_n_1 if _n==1
	gen `var'_man=`var'_n_2 if _n==2
	replace `var'_man=`var'_y_3 if _n==3
	replace `var'_man=`var'_y_4 if _n==4
	gen `var'_wom=`var'_y_2 if _n==2
	replace `var'_wom=`var'_n_3 if _n==3
	replace `var'_wom=`var'_n_4 if _n==4
}
twoway (rbar ci_low_g_wom ci_high_g_wom pos_g_wom , lwidth(vvthin)  fcolor(maroon) lcolor(maroon) lpattern(solid) barwidth(.015)) ///
	(scatter est_g_wom pos_g_wom   , msize(medlarge)  msymbol(circle)   mcolor(maroon)) ///
	(rbar ci_low_g_man ci_high_g_man pos_g_man , lwidth(vvthin)  fcolor(navy) lcolor(navy) lpattern(solid) barwidth(.015)) ///
	(scatter est_g_man pos_g_man   , msize(medlarge)  msymbol(circle)   mcolor(navy)) ///
	(rbar ci_low_g_by ci_high_g_by pos_g_by , lwidth(vvthin)  fcolor(gs5) lcolor(gs5) lpattern(solid) barwidth(.015)) ///
	(scatter est_g_by pos_g_by   , msize(medlarge)  msymbol(circle)   mcolor(gs5)) ///
	(rbar ci_low_g_vic ci_high_g_vic pos_g_vic , lwidth(vvthin)  fcolor(gs1) lcolor(gs1) lpattern(solid) barwidth(.015)) ///
	(scatter est_g_vic pos_g_vic   , msize(medlarge)  msymbol(circle)   mcolor(gs1)) ///
	(rbar ci_low_s_wom ci_high_s_wom pos_s_wom , lwidth(vvthin)  fcolor(maroon) lcolor(maroon) lpattern(solid) barwidth(.015)) ///
	(scatter est_s_wom pos_s_wom   , msize(medlarge)  msymbol(triangle)   mcolor(maroon)) ///
	(rbar ci_low_s_man ci_high_s_man pos_s_man , lwidth(vvthin)  fcolor(navy) lcolor(navy) lpattern(solid) barwidth(.015)) ///
	(scatter est_s_man pos_s_man   , msize(medlarge)  msymbol(triangle)   mcolor(navy)) ///
	(rbar ci_low_s_by ci_high_s_by pos_s_by , lwidth(vvthin)  fcolor(gs5) lcolor(gs5) lpattern(solid) barwidth(.015)) ///
	(scatter est_s_by pos_s_by   , msize(medlarge)  msymbol(triangle)   mcolor(gs5)) ///
	(rbar ci_low_s_vic ci_high_s_vic pos_s_vic , lwidth(vvthin)  fcolor(gs1) lcolor(gs1) lpattern(solid) barwidth(.015)) ///
	(scatter est_s_vic pos_s_vic   , msize(medlarge)  msymbol(triangle)   mcolor(gs1)) ///
	(rbar ci_low_h_wom ci_high_h_wom pos_h_wom , lwidth(vvthin)  fcolor(maroon) lcolor(maroon) lpattern(solid) barwidth(.015)) ///
	(scatter est_h_wom pos_h_wom   , msize(medlarge)  msymbol(square)   mcolor(maroon)) ///
	(rbar ci_low_h_man ci_high_h_man pos_h_man , lwidth(vvthin)  fcolor(navy) lcolor(navy) lpattern(solid) barwidth(.015)) ///
	(scatter est_h_man pos_h_man   , msize(medlarge)  msymbol(square)   mcolor(navy)) ///
	(rbar ci_low_h_by ci_high_h_by pos_h_by , lwidth(vvthin)  fcolor(gs5) lcolor(gs5) lpattern(solid) barwidth(.015)) ///
	(scatter est_h_by pos_h_by   , msize(medlarge)  msymbol(square)   mcolor(gs5)) ///
	(rbar ci_low_h_vic ci_high_h_vic pos_h_vic , lwidth(vvthin)  fcolor(gs1) lcolor(gs1) lpattern(solid) barwidth(.015)) ///
	(scatter est_h_vic pos_h_vic   , msize(medlarge)  msymbol(square)   mcolor(gs1)) ///
	,xline(1.5 2.5 3.5 , lcolor(gs1) lpattern(dash))  xscale(range(0.5 4.5)) yline(0, lcolor(gs7) lpattern(dash)) ///
	ylabel( , labsize(medsmall) angle(horizontal))  scale(.7) ysize(15) xsize(20) scheme(s1mono) title(`split' `gen') ///
	xlabel( .8 "Opposite-Sex" 1.2 "Victim" 1.8 "Opposite-Sex" 2.2 "Victim" /// 
	2.8 "Opposite-Sex" 3.2 "Victim" 3.8 "Opposite-Sex" 4.2 "Victim" , labsize(medsmall) angle(45))
graph save Figure_A16, replace
restore
}
			
*Figure A17
foreach gen in b {
foreach sample in all wom man vic by{
	matrix C =J(17,5,.)
*Run regression
	reg pref_`gen' ej_ut_`gen'- conf_`gen' sekuhara_`gen' if `sample'==1 & dominant==0  [pw= gen_edu2_alder5_w],  cluster(id)
*Store estimates
	replace heading="Skill development" if _n==1
	replace heading_pos=4 if _n==1
	matrix C[3,1]=_b[ej_ut_`gen']
	matrix C[3,2]=(_b[ej_ut_`gen']+1.96*_se[ej_ut_`gen'])
	matrix C[3,3]=(_b[ej_ut_`gen']-1.96*_se[ej_ut_`gen'])
	matrix C[2,1]=0
	matrix C[1,1]=_b[mkt_ut_`gen']
	matrix C[1,2]=(_b[mkt_ut_`gen']+1.96*_se[mkt_ut_`gen'])
	matrix C[1,3]=(_b[mkt_ut_`gen']-1.96*_se[mkt_ut_`gen'])
	replace heading="Time flexibility" if _n==2
	replace heading_pos=8 if _n==2
	matrix C[7,1]=_b[ej_inf_`gen']
	matrix C[7,2]=(_b[ej_inf_`gen']+1.96*_se[ej_inf_`gen'])
	matrix C[7,3]=(_b[ej_inf_`gen']-1.96*_se[ej_inf_`gen']) 
	matrix C[6,1]=0
	matrix C[5,1]=_b[fri_sch_`gen']
	matrix C[5,2]=(_b[fri_sch_`gen']+1.96*_se[fri_sch_`gen'])
	matrix C[5,3]=(_b[fri_sch_`gen']-1.96*_se[fri_sch_`gen'])
	replace heading="Wage" if _n==3
	replace heading_pos=13 if _n==3
	matrix C[12,1]=_b[low_5_`gen']
	matrix C[12,2]=(_b[low_5_`gen']+1.96*_se[low_5_`gen'])
	matrix C[12,3]=(_b[low_5_`gen']-1.96*_se[low_5_`gen'])
	matrix C[11,1]=0
	matrix C[10,1]=_b[high_5_`gen']
	matrix C[10,2]=(_b[high_5_`gen']+1.96*_se[high_5_`gen'])
	matrix C[10,3]=(_b[high_5_`gen']-1.96*_se[high_5_`gen'])
	matrix C[9,1]=_b[high_10_`gen']
	matrix C[9,2]=(_b[high_10_`gen']+1.96*_se[high_10_`gen'])
	matrix C[9,3]=(_b[high_10_`gen']-1.96*_se[high_10_`gen'])
	replace heading="Work environment" if _n==4
	replace heading_pos=18 if _n==4
	matrix C[14,1]=_b[happy_`gen']
	matrix C[14,2]=(_b[happy_`gen']+1.96*_se[happy_`gen'])
	matrix C[14,3]=(_b[happy_`gen']-1.96*_se[happy_`gen'])
	matrix C[15,1]=0
	matrix C[17,1]=_b[sekuhara_`gen']
	matrix C[17,2]=(_b[sekuhara_`gen']+1.96*_se[sekuhara_`gen'])
	matrix C[17,3]=(_b[sekuhara_`gen']-1.96*_se[sekuhara_`gen'])
	matrix C[16,1]=_b[conf_`gen']
	matrix C[16,2]=(_b[conf_`gen']+1.96*_se[conf_`gen'])
	matrix C[16,3]=(_b[conf_`gen']-1.96*_se[conf_`gen'])
	svmat C
	ren C1 est
	ren C2 ci_low
	ren C3 ci_high
	gen pos=_n if est!=.

twoway (scatter  pos est  , msize(large) scheme(s1mono) ysize(10) mlabcolor(black)) ///
	(rbar ci_low ci_high pos , lwidth(vvthin) lpattern(solid) horizontal barwidth(.015)), /// 
	xline(0, lcolor(gs7) lpattern(dash))  ylabel( 3 "Not Developing" 2 "Developing" 1 "Very Developing" ///
	7 "No Flexibility" 6 "1 Hour Flexibility" 5 "Free Scheduling" ///
	12 "5% Lower Wage" 11 "Same Wage" 10 "5% Higher Wage" 9 "10% Higher Wage" ///
	14 "Good Atmosphere" 15 "No Information" 17 "Sexual Harassment" 16 "Manager Conflict" ///
	,labsize(medlarge) angle(horizontal)) legend(off) title(`sample' `gen') xtitle(Avergage Marginal Component Effect)
graph save hara_con_`sample'_`gen', replace
drop est- pos
	}
}
graph combine  hara_con_wom_b.gph hara_con_man_b.gph ///
	hara_con_by_b.gph hara_con_vic_b.gph , ///
	scheme(s1mono) ysize(9) xsize(20) ycommon xcommon iscale(.6) col(4)
	graph save Figure_A17, replace	

	*Figure A10	
foreach sample in  flex_imp dev_imp wage_imp sh_imp  {
	preserve
	local s=0
	local s=`s'+1
	matrix C =J(17,3,.)
*Run regression
	reg pref_b ej_ut_b- conf_b sekuhara_b if `sample'==1 & dominant==0 [pw= gen_edu2_alder5_w],  cluster(id)
*Store estimates
	local w=((_b[high_5_b]/5)+(_b[high_10_b]/10)-(_b[low_5_b]/5))/.03
	matrix C[3,1]=_b[ej_ut_b]/`w'
	matrix C[3,2]=(_b[ej_ut_b]+1.96*_se[ej_ut_b])/`w'
	matrix C[3,3]=(_b[ej_ut_b]-1.96*_se[ej_ut_b])/`w'
	matrix C[2,1]=0
	matrix C[1,1]=_b[mkt_ut_b]/`w'
	matrix C[1,2]=(_b[mkt_ut_b]+1.96*_se[mkt_ut_b])/`w'
	matrix C[1,3]=(_b[mkt_ut_b]-1.96*_se[mkt_ut_b])/`w'
	matrix C[7,1]=_b[ej_inf_b]/`w'
	matrix C[7,2]=(_b[ej_inf_b]+1.96*_se[ej_inf_b])/`w'
	matrix C[7,3]=(_b[ej_inf_b]-1.96*_se[ej_inf_b]) /`w'
	matrix C[6,1]=0
	matrix C[5,1]=_b[fri_sch_b]/`w'
	matrix C[5,2]=(_b[fri_sch_b]+1.96*_se[fri_sch_b])/`w'
	matrix C[5,3]=(_b[fri_sch_b]-1.96*_se[fri_sch_b])/`w'
	matrix C[12,1]=_b[happy_b] /`w'
	matrix C[12,2]=(_b[happy_b]+1.96*_se[happy_b])/`w'
	matrix C[12,3]=(_b[happy_b]-1.96*_se[happy_b])/`w'
	matrix C[11,1]=0
	matrix C[10,1]=_b[sekuhara_b]/`w'
	matrix C[10,2]=(_b[sekuhara_b]+1.96*_se[sekuhara_b])/`w'
	matrix C[10,3]=(_b[sekuhara_b]-1.96*_se[sekuhara_b])/`w'
	matrix C[9,1]=_b[conf_b]/`w'
	matrix C[9,2]=(_b[conf_b]+1.96*_se[conf_b])/`w'
	matrix C[9,3]=(_b[conf_b]-1.96*_se[conf_b])/`w'
	svmat C
	matrix list C
	ren C1 est_`s'
	ren C2 ci_low_`s'
	ren C3 ci_high_`s'
	gen pos_`s'=_n if est_`s'!=.
	replace pos_1=pos_1

twoway (scatter  pos_1 est_1  , msize(medlarge)  msymbol(circle)   mcolor(black)) ///
	(rbar ci_low_1 ci_high_1 pos_1 , lwidth(vvthin) lcolor(maroon) lpattern(solid) horizontal barwidth(.015)) ///
	,xline(0, lcolor(gs7) lpattern(dash)) yline(4 8, lcolor(gs1) lpattern(dot)) ///
	ylabel(  3 "Low Skill Development" 2 "Moderate Skill Development" 1 "High Skill Development" ///
	7 "No Flexibility" 6 "1 Hour Flexibility" 5 "Free Scheduling" ///
	12 "Good Atmosphere" 11 "No Information" 10 "Sexual Harassment" 9 "Manager Conflict" ///
	,labsize(medlarge) angle(horizontal)) yscale(range(0.5 12.5)) scale(1) ysize(20) xsize(20) scheme(s1mono) title(`sample' )
graph save hara_wtp_`sample', replace
restore
}	

graph combine hara_wtp_sh_imp.gph  hara_wtp_flex_imp.gph hara_wtp_dev_imp.gph hara_wtp_wage_imp.gph, ///
scheme(s1mono) ysize(11) xsize(20)  xcommon iscale(.7) col(4)
graph save Figure_A10, replace

*Figure A18
preserve
local s=0
matrix C =J(5,6,.)
*************
***No weights
local s=`s'+1
*Run Regression
reg pref_b ej_ut_vic- sekuhara_vic ej_ut_by-sekuhara_by if    dominant==0   ,   cluster(id) 
*Store estimates
local w_by=((_b[high_5_by]/5)+(_b[high_10_by]/10)-(_b[low_5_by]/5))/.03
local w_vic=((_b[high_5_vic]/5)+(_b[high_10_vic]/10)-(_b[low_5_vic]/5))/.03
nlcom (wtp_by: _b[sekuhara_by]/`w_by') ///
(wtp_vic: _b[sekuhara_vic]/`w_vic'), post
matrix C[`s',1]=_b[wtp_by]
matrix C[`s',2]=(_b[wtp_by]+1.96*_se[wtp_by])
matrix C[`s',3]=(_b[wtp_by]-1.96*_se[wtp_by])
matrix C[`s',4]=_b[wtp_vic]
matrix C[`s',5]=(_b[wtp_vic]+1.96*_se[wtp_vic])
matrix C[`s',6]=(_b[wtp_vic]-1.96*_se[wtp_vic])
test _b[wtp_vic] =_b[wtp_by]
local p`s'=  r(p)
******************
*Only attentive***
local s=`s'+1
*Run regression
reg pref_b ej_ut_vic- sekuhara_vic ej_ut_by-sekuhara_by if    dominant==0 & inattent==0 [pw= gen_edu2_alder5_w] ,   cluster(id)
*Store estimates
local w_by=((_b[high_5_by]/5)+(_b[high_10_by]/10)-(_b[low_5_by]/5))/.03
local w_vic=((_b[high_5_vic]/5)+(_b[high_10_vic]/10)-(_b[low_5_vic]/5))/.03
nlcom (wtp_by: _b[sekuhara_by]/`w_by') ///
(wtp_vic: _b[sekuhara_vic]/`w_vic'), post
matrix C[`s',1]=_b[wtp_by]
matrix C[`s',2]=(_b[wtp_by]+1.96*_se[wtp_by])
matrix C[`s',3]=(_b[wtp_by]-1.96*_se[wtp_by])
matrix C[`s',4]=_b[wtp_vic]
matrix C[`s',5]=(_b[wtp_vic]+1.96*_se[wtp_vic])
matrix C[`s',6]=(_b[wtp_vic]-1.96*_se[wtp_vic])
test _b[wtp_vic] =_b[wtp_by]
local p`s'=  r(p)
local s=`s'+1
*******************
*Probit************
probit pref_b ej_ut_vic- sekuhara_vic ej_ut_by-sekuhara_by if    dominant==0  [pw= gen_edu2_alder5_w] ,   cluster(id) 
*Store estimates
local w_by=((_b[high_5_by]/5)+(_b[high_10_by]/10)-(_b[low_5_by]/5))/.03
local w_vic=((_b[high_5_vic]/5)+(_b[high_10_vic]/10)-(_b[low_5_vic]/5))/.03
nlcom (wtp_by: _b[sekuhara_by]/`w_by') ///
(wtp_vic: _b[sekuhara_vic]/`w_vic'), post
matrix C[`s',1]=_b[wtp_by]
matrix C[`s',2]=(_b[wtp_by]+1.96*_se[wtp_by])
matrix C[`s',3]=(_b[wtp_by]-1.96*_se[wtp_by])
matrix C[`s',4]=_b[wtp_vic]
matrix C[`s',5]=(_b[wtp_vic]+1.96*_se[wtp_vic])
matrix C[`s',6]=(_b[wtp_vic]-1.96*_se[wtp_vic])
test _b[wtp_vic] =_b[wtp_by]
local p`s'=  r(p)
local s=`s'+1
********
**Logit*
logit pref_b ej_ut_vic- sekuhara_vic ej_ut_by-sekuhara_by if    dominant==0 [pw= gen_edu2_alder5_w] ,   cluster(id) 
*Store estimates
local w_by=((_b[high_5_by]/5)+(_b[high_10_by]/10)-(_b[low_5_by]/5))/.03
local w_vic=((_b[high_5_vic]/5)+(_b[high_10_vic]/10)-(_b[low_5_vic]/5))/.03
nlcom (wtp_by: _b[sekuhara_by]/`w_by') ///
(wtp_vic: _b[sekuhara_vic]/`w_vic'), post
matrix C[`s',1]=_b[wtp_by]
matrix C[`s',2]=(_b[wtp_by]+1.96*_se[wtp_by])
matrix C[`s',3]=(_b[wtp_by]-1.96*_se[wtp_by])
matrix C[`s',4]=_b[wtp_vic]
matrix C[`s',5]=(_b[wtp_vic]+1.96*_se[wtp_vic])
matrix C[`s',6]=(_b[wtp_vic]-1.96*_se[wtp_vic])
test _b[wtp_vic] =_b[wtp_by]
local p`s'=  r(p)
svmat C
ren C1 est_by
ren C2 ci_low_by
ren C3 ci_high_by
gen pos_by=_n-.2 if est_by!=.
ren C4 est_vic
ren C5 ci_low_vic
ren C6 ci_high_vic
gen pos_vic=_n+.2 if est_vic!=.

*mixed logitwtp results cannot be saved in a matrix are instead saved manually in separate data set which is then appended
gen wage =.05*high_5_b+.10*high_10_b-.05*low_5_b
sort id con_id
mixlogitwtp pref_b  happy_b conf_b sekuhara_b  if dominant==0 & by==1 [pw= gen_edu2_alder5_w] , ///
price(wage) rand(ej_ut_b- fri_sch_b) id(id) group(con_id) nrep(5)   
sort id con_id
mixlogitwtp pref_b  happy_b conf_b sekuhara_b  if dominant==0 & by==0 [pw= gen_edu2_alder5_w] , ///
price(wage) rand(ej_ut_b- fri_sch_b) id(id) group(con_id) nrep(5)  
append using mixlogit_results.dta

twoway (rbar ci_low_by ci_high_by pos_by , lwidth(vvthin)  fcolor(gs5) lcolor(gs5) lpattern(solid) barwidth(.015)) ///
	(scatter est_by pos_by   , msize(medlarge)  msymbol(circle)   mcolor(gs5)) ///
	(rbar ci_low_vic ci_high_vic pos_vic , lwidth(vvthin)  fcolor(gs1) lcolor(gs1) lpattern(solid) barwidth(.015)) ///
	(scatter est_vic pos_vic   , msize(medlarge)  msymbol(circle)   mcolor(gs1)) ///
	,xline(1.5 2.5 3.5 4.5, lcolor(gs1) lpattern(dash)) xscale(range(0.5 5.5))  yline(0, lcolor(gs7) lpattern(dash)) ///
	ylabel( , labsize(medsmall) angle(horizontal))  scale(.7) ysize(15) xsize(20) scheme(s1mono) title(`split' `gen') ///
	xlabel( .8 "Opposite-Sex Victim" 1.2 "Same-Sex Victim" 1.8 "Opposite-Sex Victim" 2.2 "Same-Sex Victim" /// 
	2.8 "Opposite-Sex Victim" 3.2 "Same-Sex Victim" 3.8 "Opposite-Sex Victim" 4.2 "Same-Sex Victim" 4.8 ///
	"Opposite-Sex Victim" 5.2 "Same-Sex Victim", labsize(medsmall) angle(45) ) ///
	title(p-value = 0`p1'  p-value = 0`p2' p-value = 0`p3' p-value = 0`p4' )
graph save Figure_A18, replace
restore
		
		
